package com.hxzy.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author 
 * 商家信息
 */
@Data
public class Merchandiser implements Serializable {
    private BigDecimal id;

    /**
     * 商家名称
     */
    @NotBlank(message = "商家名称不能为空")
    @Length(min = 1,max = 100,message = "商家名称长度在1-100个字符之间")
    private String name;

    /**
     * 商家地址
     */
    @NotBlank(message = "商家地址不能为空")
    @Length(min = 1,max = 255,message = "商家名称长度在1-255个字符之间")
    private String address;

    /**
     * 联系电话
     */
    @NotBlank(message = "联系电话不能为空")
    private String phone;

    /**
     * 商家图片
     */
    @NotBlank(message = "商家图片不能为空")
    @Length(min = 1,max = 255,message = "商家图片长度在1-255个字符之间")
    private String picture;

    /**
     * 商家位置经度
     */
    @NotNull(message = "经度不允许为空")
    private BigDecimal longitude;

    /**
     * 商家位置纬度
     */
    @NotNull(message = "纬度不允许为空")
    private BigDecimal latitude;

    /**
     * 创建时间
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 创建人
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private String createBy;

    /**
     * 修改时间
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 修改人
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private String updateBy;

    /**
     * 商家账户
     */
    @NotBlank(message = "商家账户不允许为空")
    @Pattern(regexp = "^0?(13|15|17|18|14|19)[0-9]{9}$",message = "手机号码格式不正确，只支持(13|14|15|17|18|19)开头的")
    private String loginName;

    /**
     * 商家密码
     */
    @NotBlank(message = "商家密码不允许为空")
    @Length(min = 4,max = 50,message = "密码长度必须在4-50个字符之间")
    private String loginPwd;

    /**
     * 审核状态（0审核通过，1未审核, 2审核不通过）
     */
    private Short status;

    private static final long serialVersionUID = 1L;
}